var collection;
pi.util.Init.push(function(){
	
	collection = new pi.cache("selectbox",pi.storage).environment.setIsPermanent(true).importDOMStorage();

	for(var key in collection.environment.getData()){
		var item = collection.environment.getData()[ key ]
		new pi.element("option").attribute.set("value",key).update( item.environment.getData() ).insert( pi.get("selectbox") );
	}
});

function Add(_value,_selectbox){
	var item = new pi.cache.item().environment.setData(_value);
	collection.append(item);
	pi.get("selectbox").appendChild(
		new pi.element("option").attribute.set("name",item.environment.getName()).update(_value).element
	);
};
